package
{
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	
	public class xmlGetter
	{
		private var _myLoader:URLLoader = new URLLoader();
		private var _myURL:URLRequest;
		private var _onComplete:Function;
		private var _scope:Object;
		private var _xml:XML;
		
		public function xmlGetter(scope:Object, onComplete:Function, DBId:int)
		{
			XML.ignoreComments=true;
			XML.ignoreWhitespace=true;
			
			_myURL = new URLRequest("xml/stdgang.xml");
			_myLoader.load(_myURL);
			_myLoader.addEventListener(Event.COMPLETE, onResponse);
			_onComplete = onComplete;
			_scope = scope;
		}
		
		private function onResponse(e:Event):void
		{
			_xml = new XML(e.target.data);
			_onComplete.apply(_scope,[_xml]);
		
		} 
	}
}